
<!DOCTYPE HTML>
<html lang="en" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>4.5.2 自定义命令|stats与记分板 · 命令进阶</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../../styles/website.css">
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="example3.html" />
    
    
    <link rel="prev" href="example1.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    引言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../../concepts/concepts.html">
            
                <a href="../../concepts/concepts.html">
            
                    
                    1 基础概念
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../../concepts/space.html">
            
                <a href="../../concepts/space.html">
            
                    
                    1.1 坐标、朝向、区块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../../concepts/time.html">
            
                <a href="../../concepts/time.html">
            
                    
                    1.2 时间、顺序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../../concepts/execution.html">
            
                <a href="../../concepts/execution.html">
            
                    
                    1.3 命令执行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../../concepts/selector/selector.html">
            
                <a href="../../concepts/selector/selector.html">
            
                    
                    1.4 目标选择器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../../concepts/stats.html">
            
                <a href="../../concepts/stats.html">
            
                    
                    1.5 命令执行统计
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../../common-format/common-format.html">
            
                <a href="../../common-format/common-format.html">
            
                    
                    2 常用命令格式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../../common-format/json/json.html">
            
                <a href="../../common-format/json/json.html">
            
                    
                    2.1 JSON文本
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="../../common-format/json/type.html">
            
                <a href="../../common-format/json/type.html">
            
                    
                    2.1.1 JSON文本类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="../../common-format/json/formatting.html">
            
                <a href="../../common-format/json/formatting.html">
            
                    
                    2.1.2 JSON样式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.3" data-path="../../common-format/json/event.html">
            
                <a href="../../common-format/json/event.html">
            
                    
                    2.1.3 JSON事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.4" data-path="../../common-format/json/array.html">
            
                <a href="../../common-format/json/array.html">
            
                    
                    2.1.4 JSON分项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.5" data-path="../../common-format/json/sign-book.html">
            
                <a href="../../common-format/json/sign-book.html">
            
                    
                    2.1.5 告示牌及成书
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.6" data-path="../../common-format/json/other.html">
            
                <a href="../../common-format/json/other.html">
            
                    
                    2.1.6 杂项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.7" data-path="../../common-format/json/keys.html">
            
                <a href="../../common-format/json/keys.html">
            
                    
                    2.1.A 附录: keybind列表
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../../common-format/nbt/nbt.html">
            
                <a href="../../common-format/nbt/nbt.html">
            
                    
                    2.2 NBT及结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.1" data-path="../../common-format/nbt/simple.html">
            
                <a href="../../common-format/nbt/simple.html">
            
                    
                    2.2.1 基本类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.2" data-path="../../common-format/nbt/example.html">
            
                <a href="../../common-format/nbt/example.html">
            
                    
                    2.2.2 NBT实战
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../../command/command.html">
            
                <a href="../../command/command.html">
            
                    
                    3 如何执行命令
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../../command/chat.html">
            
                <a href="../../command/chat.html">
            
                    
                    3.1 聊天栏
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../../command/cb.html">
            
                <a href="../../command/cb.html">
            
                    
                    3.2 命令方块简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../../command/function.html">
            
                <a href="../../command/function.html">
            
                    
                    3.3 命令函数
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../scoreboard.html">
            
                <a href="../scoreboard.html">
            
                    
                    4 记分板
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../objective.html">
            
                <a href="../objective.html">
            
                    
                    4.1 记分板变量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../team.html">
            
                <a href="../team.html">
            
                    
                    4.2 记分板队伍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../tag.html">
            
                <a href="../tag.html">
            
                    
                    4.3 记分板标签
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../command.html">
            
                <a href="../command.html">
            
                    
                    4.4 记分板命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../example.html">
            
                <a href="../example.html">
            
                    
                    4.5 记分板实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.5.1" data-path="example1.html">
            
                <a href="example1.html">
            
                    
                    4.5.1 循环电路|记分板的基础操作
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.5.2" data-path="example2.html">
            
                <a href="example2.html">
            
                    
                    4.5.2 自定义命令|stats与记分板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.3" data-path="example3.html">
            
                <a href="example3.html">
            
                    
                    4.5.3 击杀率|operation与准则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.4" data-path="example4.html">
            
                <a href="example4.html">
            
                    
                    4.5.4 漂亮的排名|显示与队伍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5.5" data-path="example5.html">
            
                <a href="example5.html">
            
                    
                    4.5.5 简单登入系统|function与综合运用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../../logic/logic.html">
            
                <a href="../../logic/logic.html">
            
                    
                    5 基础逻辑
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../../logic/enum.html">
            
                <a href="../../logic/enum.html">
            
                    
                    5.1 穷举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../../logic/score.html">
            
                <a href="../../logic/score.html">
            
                    
                    5.2 分数处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../../logic/bool.html">
            
                <a href="../../logic/bool.html">
            
                    
                    5.3 布尔逻辑
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../../logic/loop.html">
            
                <a href="../../logic/loop.html">
            
                    
                    5.4 循环
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../../logic/event.html">
            
                <a href="../../logic/event.html">
            
                    
                    5.5 事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../../logic/marker.html">
            
                <a href="../../logic/marker.html">
            
                    
                    5.6 实体Marker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../../logic/execute.html">
            
                <a href="../../logic/execute.html">
            
                    
                     5.7 execute进阶
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../../practise/practise.html">
            
                <a href="../../practise/practise.html">
            
                    
                    6 实战
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../../practise/objects.html">
            
                <a href="../../practise/objects.html">
            
                    
                    6.1 游戏内物件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../../practise/test-debug.html">
            
                <a href="../../practise/test-debug.html">
            
                    
                    6.2 命令系统测试及调试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../../practise/examples/examples.html">
            
                <a href="../../practise/examples/examples.html">
            
                    
                    6.3 更多命令系统例子
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.3.1" data-path="../../practise/examples/furnace.html">
            
                <a href="../../practise/examples/furnace.html">
            
                    
                    6.3.1 熔炉过热系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.2" data-path="../../practise/examples/badapple.html">
            
                <a href="../../practise/examples/badapple.html">
            
                    
                    6.3.2 毒苹果
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.3" data-path="../../practise/examples/rain.html">
            
                <a href="../../practise/examples/rain.html">
            
                    
                    6.3.3 下雨检测
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.4" data-path="../../practise/examples/chest_replace.html">
            
                <a href="../../practise/examples/chest_replace.html">
            
                    
                    6.3.4 替换方块实体
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.5" data-path="../../practise/examples/skill.html">
            
                <a href="../../practise/examples/skill.html">
            
                    
                    6.3.5 技能系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.6" data-path="../../practise/examples/crown.html">
            
                <a href="../../practise/examples/crown.html">
            
                    
                    6.3.6 皇冠系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.7" data-path="../../practise/examples/blackhole.html">
            
                <a href="../../practise/examples/blackhole.html">
            
                    
                    6.3.7 黑洞
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.8" data-path="../../practise/examples/login.html">
            
                <a href="../../practise/examples/login.html">
            
                    
                    6.3.8 登录系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../../data-files/data-files.html">
            
                <a href="../../data-files/data-files.html">
            
                    
                    7 游戏文件的使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../../data-files/resourcepack/resourcepack.html">
            
                <a href="../../data-files/resourcepack/resourcepack.html">
            
                    
                    7.1 资源包
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1.1" data-path="../../data-files/resourcepack/textures.html">
            
                <a href="../../data-files/resourcepack/textures.html">
            
                    
                    7.1.1 材质
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.1.2" data-path="../../data-files/resourcepack/models.html">
            
                <a href="../../data-files/resourcepack/models.html">
            
                    
                    7.1.2 模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.1.3" data-path="../../data-files/resourcepack/sound.html">
            
                <a href="../../data-files/resourcepack/sound.html">
            
                    
                    7.1.3 声音
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../../data-files/loot-table.html">
            
                <a href="../../data-files/loot-table.html">
            
                    
                    7.2 Loot table
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../../data-files/advancements/advancements.html">
            
                <a href="../../data-files/advancements/advancements.html">
            
                    
                    7.3 Advancement
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.3.1" data-path="../../data-files/advancements/examples.html">
            
                <a href="../../data-files/advancements/examples.html">
            
                    
                    Advancement例子
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" >
            
                <span>
            
                    
                    8 杂项
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" >
            
                <a target="_blank" href="https://commandtutorials.neocities.org/">
            
                    
                    8.1 其他资源
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../../misc/success.html">
            
                <a href="../../misc/success.html">
            
                    
                    8.2 如何成为一个成功的CBer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../../misc/question.html">
            
                <a href="../../misc/question.html">
            
                    
                    8.3 问问题的技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../../misc/quotes.html">
            
                <a href="../../misc/quotes.html">
            
                    
                    8.4 其他CBer的建言
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >4.5.2 自定义命令|stats与记分板</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x5B9E;&#x4F8B;2&#xFF1A;&#x81EA;&#x5B9A;&#x4E49;&#x547D;&#x4EE4;&#x2014;&#x2014;stats&#x4E0E;&#x8BB0;&#x5206;&#x677F;">&#x5B9E;&#x4F8B;2&#xFF1A;&#x81EA;&#x5B9A;&#x4E49;&#x547D;&#x4EE4;&#x2014;&#x2014;stats&#x4E0E;&#x8BB0;&#x5206;&#x677F;</h1>
<p> &#x5728;&#x5236;&#x4F5C;&#x5730;&#x56FE;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4F60;&#x60F3;&#x8BA9;&#x73A9;&#x5BB6;&#x968F;&#x65F6;&#x968F;&#x5730;&#x90FD;&#x53EF;&#x4EE5;&#x89E6;&#x53D1;&#x4E00;&#x6BB5;&#x9884;&#x8BBE;&#x597D;&#x7684;&#x547D;&#x4EE4;&#x2014;&#x2014;&#x6BD4;&#x5982;&#x5728;&#x73A9;&#x5BB6;&#x6240;&#x5904;&#x7684;&#x4F4D;&#x7F6E;&#x653E;&#x4E00;&#x7C07;&#x70DF;&#x82B1;&#x3002;&#x4F46;&#x4F60;&#x603B;&#x4E0D;&#x80FD;&#x8BA9;&#x73A9;&#x5BB6;&#x5E26;&#x7740;&#x4E00;&#x4E2A;&#x547D;&#x4EE4;&#x65B9;&#x5757;&#xFF0C;&#x4E5F;&#x4E0D;&#x80FD;&#x4E00;&#x76F4;&#x63D0;&#x793A;&#x73A9;&#x5BB6;&#x6253;&#x4E00;&#x6761;&#x653E;&#x7F6E;&#x7EA2;&#x77F3;&#x5757;&#x7684;<code>setblock</code>&#x547D;&#x4EE4;&#x5427;&#xFF1F;&#x4E0B;&#x9762;&#x5C31;&#x4ECB;&#x7ECD;&#x4E00;&#x4E0B;&#x5982;&#x4F55;&#x5236;&#x4F5C;&#x4E00;&#x6761;&#x201C;&#x81EA;&#x5B9A;&#x4E49;&#x547D;&#x4EE4;&#x201D;&#xFF0C;&#x8BA9;&#x73A9;&#x5BB6;&#x8F7B;&#x677E;&#x5730;&#x5F00;&#x70DF;&#x706B;&#x5927;&#x4F1A;&#x3002;</p>
<h2 id="&#x521D;&#x6B21;&#x5B9E;&#x73B0;">&#x521D;&#x6B21;&#x5B9E;&#x73B0;</h2>
<p>&#x6709;&#x4E86;&#x5B9E;&#x4F8B;1&#x7684;&#x7ECF;&#x9A8C;&#xFF0C;&#x8FD9;&#x4E00;&#x8282;&#x5C31;&#x5E94;&#x8BE5;&#x8F7B;&#x677E;&#x4E00;&#x4E9B;&#x4E86;&#x3002;</p>
<p>&#x4E4B;&#x524D;&#x5728;&#x4ECB;&#x7ECD;&#x547D;&#x4EE4;&#x65F6;&#x6211;&#x4EEC;&#x63D0;&#x5230;&#x8FC7;&#xFF0C;&#x666E;&#x901A;&#x73A9;&#x5BB6;&#x4E0D;&#x80FD;&#x4F7F;&#x7528;<code>scoreboard</code>&#x547D;&#x4EE4;&#xFF0C;&#x4F46;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;<code>trigger</code>&#x547D;&#x4EE4;&#x4FEE;&#x6539;&#x89E6;&#x53D1;&#x5668;&#xFF0C;&#x6240;&#x4EE5;&#x6211;&#x4EEC;&#x5148;&#x7528;&#x89E6;&#x53D1;&#x5668;&#x5B9E;&#x73B0;&#x81EA;&#x5B9A;&#x4E49;&#x547D;&#x4EE4;&#x3002;</p>
<p>&#x5148;&#x65B0;&#x5EFA;&#x4E00;&#x4E2A;&#x89E6;&#x53D1;&#x5668;&#xFF0C;&#x540D;&#x5B57;&#x53EB;Firework&#xFF1A;</p>
<p><code>scoreboard objectives set Firework trigger</code></p>
<p>&#x63A5;&#x7740;&#x5F80;&#x4E00;&#x4E2A;&#x5355;&#x72EC;&#x7684;&#x5FAA;&#x73AF;&#x65B9;&#x5757;&#x4E2D;&#x653E;&#x5165;&#x8BA9;&#x6240;&#x6709;&#x73A9;&#x5BB6;&#x80FD;&#x591F;&#x64CD;&#x4F5C;&#x89E6;&#x53D1;&#x5668;&#x7684;enable&#x547D;&#x4EE4;&#xFF1A;</p>
<p><code>scoreboard players enable @a Firework</code></p>
<p>&#x7136;&#x540E;&#x628A;&#x8FD9;&#x4E2A;&#x65B9;&#x5757;&#x8C03;&#x6210;&#x4FDD;&#x6301;&#x5F00;&#x542F;&#x6A21;&#x5F0F;&#x3002;&#x4E00;&#x65E6;&#x73A9;&#x5BB6;&#x7528;<code>trigger</code>&#x64CD;&#x4F5C;&#x4E86;&#x89E6;&#x53D1;&#x5668;&#xFF0C;&#x8981;&#x60F3;&#x518D;&#x6B21;&#x64CD;&#x4F5C;&#xFF0C;&#x5C31;&#x5F97;&#x91CD;&#x65B0;&#x4F7F;&#x7528;enable&#x547D;&#x4EE4;&#x3002;&#x8FD9;&#x5C31;&#x662F;&#x628A;enable&#x653E;&#x5165;&#x5FAA;&#x73AF;&#x65B9;&#x5757;&#x7684;&#x539F;&#x56E0;&#x3002;</p>
<p>&#x5230;&#x8FD9;&#x91CC;&#x51C6;&#x5907;&#x5DE5;&#x4F5C;&#x5C31;&#x7ED3;&#x675F;&#x4E86;&#xFF0C;&#x63D0;&#x793A;&#x73A9;&#x5BB6;&#x4F7F;&#x7528;<code>trigger</code>&#x5427;&#x3002;&#x63D0;&#x793A;&#x65B9;&#x5F0F;&#x968F;&#x4F60;&#x9009;&#x62E9;&#xFF0C;&#x6728;&#x724C;&#x6216;&#x662F;<code>say</code>&#x90FD;&#x53EF;&#x4EE5;&#x3002;</p>
<p>&#x6700;&#x540E;&#x7684;&#x5B9E;&#x73B0;&#x5C31;&#x662F;&#x68C0;&#x6D4B;&#x73A9;&#x5BB6;&#x7684;&#x5206;&#x6570;&#x4EE5;&#x6267;&#x884C;&#x76F8;&#x5173;&#x64CD;&#x4F5C;&#x4E86;&#xFF0C;&#x540C;&#x5FAA;&#x73AF;&#x7535;&#x8DEF;&#x4E2D;&#x7684;&#x90A3;&#x6837;&#xFF0C;&#x68C0;&#x6D4B;&#xFF0C;&#x68C0;&#x6D4B;&#x6210;&#x7ACB;&#x65F6;&#x590D;&#x4F4D;&#xFF0C;&#x53EC;&#x5524;&#x70DF;&#x706B;&#x3002;</p>
<p>&#x65B9;&#x5757;&#x7684;&#x6A21;&#x5F0F;&#x8BBE;&#x7F6E;&#x4E5F;&#x5F88;&#x7B80;&#x5355;&#xFF0C;&#x68C0;&#x6D4B;&#x547D;&#x4EE4;&#x653E;&#x5165;&#x4FDD;&#x6301;&#x5F00;&#x542F;&#x7684;&#x5FAA;&#x73AF;&#x65B9;&#x5757;&#xFF0C;&#x5269;&#x4E0B;&#x7684;&#x547D;&#x4EE4;&#x5168;&#x90E8;&#x653E;&#x5165;&#x8FDE;&#x63A5;&#x5FAA;&#x73AF;&#x65B9;&#x5757;&#x7684;&#x6761;&#x4EF6;&#x5236;&#x7EA6;&#x8FDE;&#x9501;&#x65B9;&#x5757;&#x3002;&#x522B;&#x5FD8;&#x4E86;&#x5F00;&#x542F;&#x8FDE;&#x9501;&#x65B9;&#x5757;&#xFF01;</p>
<p>&#x5177;&#x4F53;&#x64CD;&#x4F5C;&#x76F8;&#x4FE1;&#x4F60;&#x80FD;&#x81EA;&#x5DF1;&#x5B8C;&#x6210;&#xFF0C;&#x4E0D;&#x61C2;&#x7684;&#x8BDD;&#x53EF;&#x4EE5;&#x518D;&#x770B;&#x770B;&#x7B2C;&#x4E00;&#x4E2A;&#x5B9E;&#x4F8B;&#x3002;</p>
<p>&#x5982;&#x679C;&#x4F60;&#x9700;&#x8981;&#x653E;&#x70DF;&#x82B1;&#x7684;&#x547D;&#x4EE4;&#xFF0C;&#x53EF;&#x4EE5;&#x770B;&#x770B;&#x793E;&#x533A;&#x7684;&#x6559;&#x7A0B;&#x3002;</p>
<h2 id="&#x518D;&#x6B21;&#x5B9E;&#x73B0;">&#x518D;&#x6B21;&#x5B9E;&#x73B0;</h2>
<p>&#x5982;&#x679C;&#x4F60;&#x66FE;&#x7ECF;&#x63A5;&#x89E6;&#x8FC7;&#x81EA;&#x5B9A;&#x4E49;&#x547D;&#x4EE4;&#xFF0C;&#x4F60;&#x4F1A;&#x53D1;&#x73B0;&#x5B83;&#x4EEC;&#x5927;&#x591A;&#x662F;&#x7528;Json&#x6587;&#x672C;&#x4E2D;&#x7684;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;&#xFF08;clickEvent&#xFF09;&#x6216;&#x8005;<code>gamerule</code>&#x5236;&#x4F5C;&#x7684;&#x3002;&#x56E0;&#x4E3A;&#x4F7F;&#x7528;<code>trigger</code>&#x9700;&#x8981;<strong>&#x4E24;&#x4E2A;</strong>&#x6301;&#x7EED;&#x6267;&#x884C;&#x547D;&#x4EE4;&#x7684;&#x5FAA;&#x73AF;&#x65B9;&#x5757;&#xFF0C;&#x4F1A;&#x5360;&#x7528;&#x4E00;&#x5B9A;&#x7684;&#x6E38;&#x620F;&#x8D44;&#x6E90;&#x3002;&#x800C;<code>gamerule</code>&#x53EA;&#x7528;&#x5230;<strong>&#x4E00;&#x4E2A;</strong>&#x5FAA;&#x73AF;&#x65B9;&#x5757;&#x2014;&#x2014;&#x6301;&#x7EED;&#x5730;&#x68C0;&#x6D4B;&#x800C;&#x5DF2;&#x3002;&#x81F3;&#x4E8E;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;&#xFF0C;&#x66F4;&#x662F;<strong>&#x4E0D;&#x9700;&#x8981;</strong>&#x5FAA;&#x73AF;&#x65B9;&#x5757;&#x3002;<br>&#x8FD9;&#x91CC;&#x4ECB;&#x7ECD;&#x4E0E;&#x8BB0;&#x5206;&#x677F;&#x76F8;&#x5173;&#x7684;<code>gamerule</code>&#x5B9E;&#x73B0;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x5BF9;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;&#x7684;&#x5B9E;&#x73B0;&#x65B9;&#x6CD5;&#x6709;&#x5174;&#x8DA3;&#xFF0C;&#x53EF;&#x4EE5;&#x770B;&#x770B;<a href="../../common-format/json/json.html">2.1 JSON&#x6587;&#x672C;</a>&#x7684;&#x4ECB;&#x7ECD;&#x3002;</p>
<h3 id="&#x5173;&#x4E8E;stats">&#x5173;&#x4E8E;<code>stats</code></h3>
<p><code>stats</code>&#x547D;&#x4EE4;&#x7684;&#x529F;&#x80FD;&#x662F;&#x6839;&#x636E;&#x67D0;&#x4E2A;&#x547D;&#x4EE4;&#x7684;&#x6267;&#x884C;&#x60C5;&#x51B5;&#xFF0C;&#x5C06;&#x6709;&#x5173;&#x6570;&#x636E;&#x63A8;&#x9001;&#x5230;&#x8BB0;&#x5206;&#x677F;&#x4E0A;&#x3002;&#x4F60;&#x53EF;&#x4EE5;&#x5728;<a href="../../concepts/stats.html">1.5 &#x547D;&#x4EE4;&#x6267;&#x884C;&#x7EDF;&#x8BA1;</a>&#x4EE5;&#x53CA;<a href="../command.html">4.4 &#x8BB0;&#x5206;&#x677F;&#x547D;&#x4EE4;</a>&#x4E86;&#x89E3;<code>stats</code>&#x7684;&#x66F4;&#x591A;&#x4FE1;&#x606F;&#x3002;<br><img src="images/scbt2.1.png" alt=""><br>/stats&#x4E00;&#x5171;&#x6709;&#x4E94;&#x79CD;&#x6A21;&#x5F0F;&#xFF0C;&#x8FD9;&#x6B21;&#x6211;&#x4EEC;&#x8981;&#x7528;&#x5230;&#x7684;&#x662F;QueryResult&#x3002;&#x8FD9;&#x79CD;&#x6A21;&#x5F0F;&#x5C06;&#x547D;&#x4EE4;&#x67E5;&#x8BE2;&#x5F97;&#x5230;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x7ACB;&#x5373;&#x63A8;&#x9001;&#x5230;&#x8BB0;&#x5206;&#x677F;&#x4E0A;&#x3002;</p>
<p>&#x4E3E;&#x4E2A;&#x4F8B;&#x5B50;&#xFF0C;&#x5982;&#x679C;&#x547D;&#x4EE4;&#x65B9;&#x5757;&#x4E2D;&#x7684;&#x547D;&#x4EE4;&#x662F;<code>time query daytime</code>&#xFF0C;&#x4F7F;&#x7528;/stats&#x5C06;&#x8BB0;&#x5206;&#x677F;&#x4E0E;&#x547D;&#x4EE4;&#x65B9;&#x5757;&#x7ED1;&#x5B9A;&#x540E;&#xFF0C;&#x8BB0;&#x5206;&#x677F;&#x4E0A;&#x7684;&#x5206;&#x6570;&#x4F1A;&#x5728;&#x547D;&#x4EE4;&#x6267;&#x884C;&#x65F6;&#x66F4;&#x6539;&#x4E3A;&#x5F53;&#x524D;&#x7684;&#x65F6;&#x95F4;&#x503C;&#x3002;&#x5982;&#x679C;&#x547D;&#x4EE4;&#x65B9;&#x5757;&#x662F;&#x5FAA;&#x73AF;&#x578B;&#x4E14;&#x5F00;&#x542F;&#x4E2D;&#x7684;&#xFF0C;&#x5219;&#x76F8;&#x5173;&#x5206;&#x6570;&#x5728;&#x6BCF;&#x4E00;&#x6E38;&#x620F;&#x523B;&#x90FD;&#x4F1A;&#x6539;&#x53D8;&#x3002;<br><img src="images/scbt2.2.png" alt=""></p>
<h3 id="&#x5173;&#x4E8E;gamerule">&#x5173;&#x4E8E;<code>gamerule</code></h3>
<p><code>gamerule</code>&#x547D;&#x4EE4;&#x53EF;&#x4EE5;&#x7528;&#x4EE5;&#x7BA1;&#x7406;&#x4E16;&#x754C;&#x7684;&#x89C4;&#x5219;&#xFF0C;&#x6BD4;&#x5982;&#x662F;&#x5426;&#x8FDB;&#x884C;&#x65E5;&#x591C;&#x4EA4;&#x66FF;&#xFF0C;&#x751F;&#x7269;&#x662F;&#x5426;&#x751F;&#x6210;&#x7B49;&#x3002;</p>
<p>&#x89C4;&#x5219;&#x662F;&#x53EF;&#x4EE5;&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#xFF0C;&#x8FD9;&#x6B63;&#x662F;<code>gamerule</code>&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x5236;&#x4F5C;&#x81EA;&#x5B9A;&#x4E49;&#x547D;&#x4EE4;&#x7684;&#x539F;&#x56E0;&#x3002;</p>
<p>&#x81EA;&#x5B9A;&#x4E49;&#x89C4;&#x5219;&#x5F88;&#x7B80;&#x5355;&#xFF0C;&#x5B83;&#x548C;&#x5047;&#x540D;&#x4E00;&#x6837;&#x4E0D;&#x5FC5;&#x58F0;&#x660E;&#xFF0C;&#x76F4;&#x63A5;&#x8F93;&#x5165;<code>gamerule &#x81EA;&#x5B9A;&#x4E49;&#x89C4;&#x5219;&#x540D; &#x6570;&#x503C;</code>&#x8FDB;&#x884C;&#x8BBE;&#x7F6E;&#x5373;&#x53EF;&#x3002;&#x8F93;&#x5165;&#x540E;&#x6E38;&#x620F;&#x4F1A;&#x81EA;&#x52A8;&#x521B;&#x5EFA;&#x65B0;&#x89C4;&#x5219;&#x4E14;&#x5C06;&#x5BF9;&#x5E94;&#x6570;&#x503C;&#x5B58;&#x5165;&#x5176;&#x4E2D;&#x3002;</p>
<p><code>gamerule</code>&#x5982;&#x679C;&#x53EA;&#x586B;&#x89C4;&#x5219;&#x540D;&#xFF0C;&#x4E0D;&#x586B;&#x5199;&#x5C06;&#x8981;&#x4FEE;&#x6539;&#x7684;&#x6570;&#x503C;&#xFF0C;&#x5C31;&#x4F1A;&#x8FD4;&#x56DE;&#x8FD9;&#x4E2A;&#x89C4;&#x5219;&#x5F53;&#x524D;&#x7684;&#x503C;&#x3002;&#x5982;&#x679C;&#x7528;<code>stats</code>&#x52A0;&#x4EE5;&#x8054;&#x7CFB;&#xFF0C;&#x8FD9;&#x4E2A;&#x503C;&#x5C31;&#x4F1A;&#x5B58;&#x5230;&#x8BB0;&#x5206;&#x677F;&#x3002;&#x592A;&#x597D;&#x4E86;&#xFF0C;&#x7740;&#x624B;&#x5236;&#x4F5C;&#x7535;&#x8DEF;&#x5427;&#xFF01;</p>
<blockquote>
<p>&#x6CE8;&#x610F;&#xFF0C;&#x6E38;&#x620F;&#x89C4;&#x5219;&#x7684;&#x6570;&#x503C;&#x9700;&#x8981;&#x4E3A; &#x6570;&#x5B57;/true/false &#x624D;&#x80FD;&#x8FD4;&#x56DE;&#x5206;&#x6570;&#x3002;true&#x4E3A;1&#xFF0C;false&#x4E3A;0&#x3002;</p>
</blockquote>
<h3 id="&#x5236;&#x4F5C;&#x7CFB;&#x7EDF;">&#x5236;&#x4F5C;&#x7CFB;&#x7EDF;</h3>
<ol>
<li><p>&#x9996;&#x5148;&#x65B0;&#x5EFA;&#x4E00;&#x4E2A;&#x865A;&#x62DF;&#x578B;&#x53D8;&#x91CF;<code>Firework</code>&#x3002;&#x547D;&#x4EE4;&#x5C31;&#x7531;&#x4F60;&#x81EA;&#x5DF1;&#x53BB;&#x8F93;&#x5165;&#x4E86;&#x3002;</p>
<p>&#x4E3A;&#x4E86;&#x50A8;&#x5B58;&#x5206;&#x6570;&#xFF0C;&#x8FD8;&#x8981;&#x65B0;&#x5EFA;&#x4E00;&#x4E2A;&#x5047;&#x540D;&#xFF0C;&#x5728;&#x8FD9;&#x91CC;&#x8BBE;&#x4E3A;<code>Result</code>&#x3002;&#x547D;&#x4EE4;&#x540C;&#x6837;&#x7531;&#x4F60;&#x81EA;&#x5DF1;&#x5B8C;&#x6210;&#xFF0C;&#x4E0D;&#x77E5;&#x9053;&#x7684;&#x8BDD;&#x53EF;&#x4EE5;&#x590D;&#x4E60;&#x524D;&#x4E00;&#x4E2A;&#x5B9E;&#x4F8B;&#x3002;</p>
</li>
<li><p>&#x7136;&#x540E;&#x65B0;&#x5EFA;&#x81EA;&#x5B9A;&#x4E49;&#x4E00;&#x4E2A;&#x540D;&#x4E3A;HaveFun&#x7684;&#x89C4;&#x5219;&#xFF0C;&#x503C;&#x8BBE;&#x4E3A;0&#xFF1A;</p>
<p><code>gamerule HaveFun 0</code></p>
</li>
<li><p>&#x653E;&#x7F6E;&#x4E00;&#x4E2A;&#x5FAA;&#x73AF;&#x65B9;&#x5757;&#xFF0C;&#x8F93;&#x5165;&#x67E5;&#x8BE2;HaveFun&#x503C;&#x7684;&#x547D;&#x4EE4;&#xFF1A;</p>
<p><code>gamerule HaveFun</code></p>
</li>
<li><p>&#x79BB;&#x5F00;&#x547D;&#x4EE4;&#x65B9;&#x5757;&#x754C;&#x9762;&#xFF0C;&#x7528;<code>stats</code>&#x5C06;&#x8FD9;&#x4E2A;&#x5FAA;&#x73AF;&#x65B9;&#x5757;&#x4E0E;&#x521A;&#x624D;&#x7684;<code>Result</code>&#x8FDE;&#x63A5;&#xFF0C;&#x4F7F;&#x63A5;&#x4E0B;&#x6765;&#x547D;&#x4EE4;&#x67E5;&#x8BE2;&#x5230;&#x7684;&#x503C;&#x80FD;&#x63A8;&#x9001;&#x5230;<code>Result</code>&#x5728;<code>Firework</code>&#x4E0A;&#x7684;&#x5206;&#x6570;&#x3002;</p>
<p><code>stats block &lt;x&gt; &lt;y&gt; &lt;z&gt; set QueryResult Result Firework</code></p>
<p>&#x5750;&#x6807;&#x7684;&#x503C;&#x5C31;&#x662F;&#x547D;&#x4EE4;&#x65B9;&#x5757;&#x7684;&#x503C;&#x4E86;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x7684;&#x51C6;&#x5FC3;&#x6307;&#x5411;&#x547D;&#x4EE4;&#x65B9;&#x5757;&#xFF0C;&#x8FD8;&#x53EF;&#x4EE5;&#x7528;Tab&#x952E;&#x5BF9;&#x547D;&#x4EE4;&#x81EA;&#x52A8;&#x8865;&#x5168;&#x3002;</p>
</li>
</ol>
<p>&#x5230;&#x8FD9;&#x91CC;&#x6838;&#x5FC3;&#x5185;&#x5BB9;&#x5C31;&#x7ED3;&#x675F;&#x4E86;&#xFF0C;&#x6709;&#x4E86;&#x8BB0;&#x5206;&#x677F;&#x7684;&#x503C;&#xFF0C;&#x4F60;&#x5C31;&#x53EF;&#x4EE5;&#x6309; &#x68C0;&#x6D4B;-&gt;&#x6267;&#x884C;&#x547D;&#x4EE4;-&gt;&#x5BF9;&#x5206;&#x6570;&#x590D;&#x4F4D; &#x7684;&#x6D41;&#x7A0B;&#x7EE7;&#x7EED;&#x6784;&#x9020;&#x4F60;&#x7684;&#x7535;&#x8DEF;&#x3002;</p>
<blockquote>
<p>&#x590D;&#x4F4D;&#x4E0D;&#x80FD;&#x50CF;&#x5FAA;&#x73AF;&#x7535;&#x8DEF;&#x90A3;&#x6837;&#x76F4;&#x63A5;&#x4FEE;&#x6539;&#x8BB0;&#x5206;&#x677F;&#xFF0C;&#x5E94;&#x8BE5;&#x4F7F;&#x7528;<code>gamerule HaveFun 0</code>&#x4FEE;&#x6539;&#x89C4;&#x5219;&#x503C;&#xFF01;</p>
</blockquote>
<p>&#x53E6;&#x5916;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x60F3;&#x5B9E;&#x73B0;&#x4E0D;&#x540C;&#x7684;&#x503C;&#x5BF9;&#x5E94;&#x4E0D;&#x540C;&#x7684;&#x6548;&#x679C;&#xFF0C;&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x591A;&#x4E2A;&#x68C0;&#x6D4B;&#x7EBF;&#x8DEF;&#xFF0C;&#x8FD9;&#x5C31;&#x7559;&#x7ED9;&#x4F60;&#x81EA;&#x5DF1;&#x53BB;&#x5C1D;&#x8BD5;&#x4E86;&#x3002;</p>
<hr>
<p><img src="images/scbt2.3.png" alt=""></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="example1.html" class="navigation navigation-prev " aria-label="Previous page: 4.5.1 循环电路|记分板的基础操作">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="example3.html" class="navigation navigation-next " aria-label="Next page: 4.5.3 击杀率|operation与准则">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"4.5.2 自定义命令|stats与记分板","level":"1.5.5.2","depth":3,"next":{"title":"4.5.3 击杀率|operation与准则","level":"1.5.5.3","depth":3,"path":"scoreboard/examples/example3.md","ref":"scoreboard/examples/example3.md","articles":[]},"previous":{"title":"4.5.1 循环电路|记分板的基础操作","level":"1.5.5.1","depth":3,"path":"scoreboard/examples/example1.md","ref":"scoreboard/examples/example1.md","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","lb2br","-sharing"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"expandable-chapters":{},"lb2br":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"命令进阶","language":"en","gitbook":"*","description":"一份Minecraft命令教程"},"file":{"path":"scoreboard/examples/example2.md","mtime":"2017-08-16T00:26:58.209Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-11-08T10:37:55.949Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

